package com.sinosoft.dsp.persistence.hibernate.dao;

import java.util.List;
import java.util.Map;

import com.sinosoft.dsp.persistence.exception.SinoPersistenceException;
import com.sinosoft.dsp.platform.components.portal.input.elements.ISinoTagElement;

public interface SearchFormDao {

	/**
	 * 查询表单的分页查询
	 * 
	 * @param hql
	 * @param fields
	 * @param offset
	 * @param pageSize
	 * @return
	 * @throws SinoPersistenceException
	 */
	public List<?> findByPageForSearchForm(final String hql,
			final Map<String, ISinoTagElement> fields, final int offset,
			final int pageSize) throws SinoPersistenceException;

	/**
	 * 通过查询表单Hql统计总数
	 * 
	 * @param hql
	 * @param fields
	 * @return
	 * @throws SinoPersistenceException
	 */
	public Long countForSearchForm(final String hql,
			final Map<String, ISinoTagElement> fields)
			throws SinoPersistenceException;

	/**
	 * 通过查询表单Hql统计总数
	 * 
	 * @param hql
	 * @param fields
	 * @return
	 * @throws SinoPersistenceException
	 */
	public Long countForSearchFormByCountSql(final String countHql,
			final Map<String, ISinoTagElement> fields)
			throws SinoPersistenceException;
}
